<!DOCTYPE >
<html lang="zh-cn">

	<head>
		<title>后台管理-文章管理</title>
		<% include ../partials/head %>
			<link rel="stylesheet" href="/assets/js/button/ladda/ladda.min.css">

	</head>

	<body>
		<header>
			<!-- Preloader -->
			<div id="preloader">
				<div id="status">&nbsp;</div>
			</div>
		</header>
		<div class="ch-container">

			<!-- 首页内容 -->
			<div class="wrap-fluid">
				<div class="container-fluid paper-wrap bevel tlbr">

					<!-- CONTENT -->
					<!--TITLE -->

					<!--/ TITLE -->

					<!-- BREADCRUMB -->
					<ul id="breadcrumb">
						<li>
							<span class="entypo-home"></span>
						</li>
						<li><i class="fa fa-lg fa-angle-right"></i>
						</li>
						<li><a href="#" title="公司管理">文章管理</a>
						</li>
					</ul>

					<!--测试数据-->
					<div class="content-wrap">
						<div class="row">
							<div class="col-sm-12">
								<div class="nest" id="FootableClose">
									<div class="title-alt">
										<h6>所有文章</h6>
										<div class="titleClose">
											<a class="gone" href="#FootableClose">
												<span class="entypo-cancel"></span>
											</a>
										</div>
										<div class="titleToggle">
											<a class="nav-toggle-alt" href="#Footable">
												<span class="entypo-up-open"></span>
											</a>
										</div>

									</div>
									<div class="body-nest" id="Filtering">

										<div class="row" style="margin-bottom:10px;">
											<div class="col-sm-4">
												<input class="form-control" id="filter" placeholder="Search..." type="text">
											</div>
											<div class="col-sm-2">
												<select class="filter-status form-control">
													<option>全部</option>
													<option value="已认证">已认证</option>
													<option value="未认证">未认证</option>
												</select>
											</div>
											<!--<div class="col-sm-2">
													<select class="filter-num form-control">
														<option value="1">每页10个
															<option value="2">每页50个
																<option value="3">每页100个
													</select>
												</div>-->
											<div class="col-sm-6">

												<a href="#clear" style="margin-left:10px;" class="pull-right btn btn-info clear-filter" title="clear filter">重置</a>
											</div>

										</div>
										<table class="table-striped footable-res footable metro-blue data-table" data-page-size="30" data-filter="#filter" data-filter-text-only="true">
											<thead>
												<tr>
													<th data-toggle="true"></th>
													<th>标题</th>
													<th>作者</th>
													<th>网址</th>
													<th>操作</th>
													<th data-hide="phone,tablet" data-sort-initial="descending">创建时间</th>
												</tr>
											</thead>
											<tbody>
												<% if (typeof articles != "undefined") { %>
													<% articles.forEach(function(article,index) { %>
														<tr>
															<td class="center">
																<%=index%>
															</td>
															<td class="center">
																<%= article.get("title") %>
															</td>
															<td class="center">
																<%= article.get("name") %>
															</td>
															<td class="center">
																<span class=" btn-success public ladda-button viewaddr" addr="<%=article.get("addr")%>" data-size="xs" data-style="zoom-in" articleId=<%=article.id%>> 点击查看
																		</span>
															</td>
															<td>
																<span class=" btn-success public ladda-button editarticle" data-size="xs" data-style="zoom-in" articleId=<%=article.id%>> 编辑
																		</span>
															</td>
															<td class="center">
																<%= Format(article.createdAt) %>
															</td>

														</tr>
														<% }) %>
															<% } %>

											</tbody>
											<tfoot>
												<tr>
													<td colspan="5">
														<div class="pagination pagination-centered"></div>
													</td>
												</tr>
											</tfoot>
										</table>
									</div>
								</div>
							</div>
						</div>
					</div>
					<!-- END OF BREADCRUMB -->

					<!-- /END OF CONTENT -->

					<!-- FOOTER -->
					<div class="footer-space"></div>
					<div id="footer">
						<div class="devider-footer-left"></div>
						<div class="time">
							<p id="spanDate">
								<p id="clock">
						</div>
						<div class="copyright">Made by HT
							<span class="entypo-heart"></span>广州聚脉互联网络服务有限公司</div>
						<div class="devider-footer"></div>

					</div>
					<!-- / END OF FOOTER -->

				</div>
			</div>

		</div>
		<% include ../partials/external %>
			<script src="/assets/js/button/ladda/spin.min.js"></script>

			<script src="/assets/js/button/ladda/ladda.min.js"></script>

			<script src="/assets/js/footable/js/footable.filter.js"></script>

			<script type="text/javascript">
				$(function() {
					$('table').on("click", ".viewaddr", function() {
						window.location.href = $(this).attr("addr");
					}).on("click",".editarticle",function(){
						window.location.href = "/admin/home/article/edit?id="+$(this).attr("articleId");
					})
				});
			</script>
			<script type="text/javascript">
			</script>
	</body>

</html>